using System.Collections.Generic;
using Battle.Data;
using Core;
using Core.Data;
using View;

namespace Battle.Managers
{
    public class UnitManager
    {
        private Dictionary<long, UnitBase> m_UnitData = new Dictionary<long, UnitBase>();

        public UnitManager(BattleWorld world)
        {
        }

        public void OnCreate(IViewBehaviour view, BattleData data)
        {
            CreateKingUnit(view, data);
        }

        private void CreateKingUnit(IViewBehaviour view, BattleData data)
        {
            //创建战斗单位后需要调用接口创建对应的显示
            KingUnit unit = new KingUnit();
            unit.UnitView = view.CreateUnitView(data.KingUnitData);
            unit.Data = data.KingUnitData;
            unit.UnitId = data.KingUnitData.UnitId;
            m_UnitData.Add(unit.UnitId, unit);
            //添加到摇杆中
        }
    }
}